import pandas as pd
# 假设这个库和函数存在，用于处理DataFrame
import pygwalker as pyg

# 加载数据并处理
df = pd.read_csv('./titanic.csv')
walker = pyg.walk(df)
# 调用to_html()获取HTML字符串
walker_html = walker.to_html()

# 将HTML字符串写入到文件
with open("1.html", "w", encoding="utf-8") as f:
    f.write(walker_html)
